watch listを書き出すscript
形式1: JS objectにする
code:js
(async () => {
const {getProjectInfo} = await import('/api/code/programming-notes/scrapboxのproject情報を一括して取得するUserScript/script.js');
const watchListIds = Object.keys(JSON.parse(localStorage.getItem('projectsLastAccessed')));
const projects = await getProjectInfo(watchListIds);
const jsCode = [
'export const projectIds = [',
...projects.map(({id, name, displayName}) => '${id}', // /${name} ${displayName}),
'];',
].join('\n');
console.log(jsCode);
navigator.clipboard.writeText(jsCode);
})();